VA Report Example: Use a pop-up page to link to additional detail
Recent Library Articles
Recently in the SAS Community Library: SAS' @TeriPatsilaras shows you how to design a pop-up page in SAS Visual Analytics to show more detail, such as category and measure data items.
PROC TEMPLATE is great for defining reusable named style elements.
However, when a named style element is used in a PROC REPORT DEFINE statement, and then a CALL DEFINE is used to modify the style, the named style element is ignored and the default style element (Data) is used instead.
Is there a way to enable inheritance so that CALL DEFINE honors the style element that was specified in the DEFINE statement?
For example, the following code shows how CALL DEFINE does not inherit the DEFINE statement's style element and instead implicitly reverts back to the "Data" style element:
data test;
input id $ num pct;
cards;
A 7777 0.831
B 8888 0.123
C 9999 0.014
;
run;
ods path(prepend) work.templat(update);
proc template;
define style example / store=work.templat(update);
parent = styles.printer;
class data / color=red;
style data_text from data / color=cyan tagattr='format:@ type:string';
style data_number from data / color=purple tagattr='format:#,##0' fontweight=bold;
style data_percent from data / color=magenta tagattr='format:0.0%' fontstyle=italic;
end;
quit;
%let xlfile=%sysfunc(pathname(work))/test.xlsx;
options device=png;
ods excel file="&xlfile" style=example;
* When named style elements are used in DEFINE, they are not inherited in
* CALL DEFINE. Instead, the style element reverts back to the default, Data. ;
proc report data=test;
columns id num pct;
define id / display style(column)=data_text;
define num / display style(column)=data_number;
define pct / display style(column)=data_percent;
compute pct;
if id='C' then do;
call define(_row_, 'style/merge', 'style=[backgroundcolor=yellow]');
end;
endcomp;
run;
ods excel close;
There are of course workarounds to get the desired styles, but none have the simple elegance and efficiency of proper inheritance.
For example, one workaround is to redundantly re-specify the style elements using additional CALL DEFINE statements:
proc report data=test;
columns id num pct;
define id / display style(column)=data_text;
define num / display style(column)=data_number;
define pct / display style(column)=data_percent;
compute pct;
if id='C' then do;
call define(_row_, 'style/merge', 'style=[backgroundcolor=yellow]');
call define('id', 'style/merge', 'style=data_text');
call define('num', 'style/merge', 'style=data_number');
call define('pct', 'style/merge', 'style=data_percent');
end;
endcomp;
run;
Another workaround is to abandon named style elements altogether, since any hard-coded styles on the DEFINE statement do properly inherit in CALL DEFINE:
proc report data=test;
columns id num pct;
define id / display style(column)=[color=cyan tagattr='format:@ type:string'];
define num / display style(column)=[color=purple tagattr='format:#,##0' fontweight=bold];
define pct / display style(column)=[color=magenta tagattr='format:0.0%' fontstyle=italic];
compute pct;
if id='C' then do;
call define(_row_, 'style/merge', 'style=[backgroundcolor=yellow]');
end;
endcomp;
run;
Are workarounds like these really the only way? Do named style elements truly suffer from such a fundamental lack of inheritance when CALL DEFINE comes into play? Or is there some way to enable that inheritance...?
... View more
In this post you’re going to learn way too much about character encoding. You’ll see how it pertains to SAS, what it even is, and much more. All of this was inspired by an interesting change I found at the tail end of updating the Implementing SAS Grid 9.4M9 workshop exercises, which we’ll also go over if we have time (we do).
... View more
The final hacking day is upon us! It is now time for teams to turn in their final submissions, which are due by October 19th. Each submission requires a Use Case Form, a short pitch video, and a longer main video. Check out this post for full guidelines, examples, and a team checklist. You’ve done the work, now it’s time to show the world!
... View more
How do we put a space between the two series? The box plots are overlapping and is there a way to put some gap between them. Sample code attached below.
data forest_data;
input Gp $ XValue a1 lowa1 uppera1 a2 lowa2 uppera2;
datalines;
A 10 0.50 0.30 0.70 0.55 0.40 0.60 B 20 0.25 0.10 0.40 0.70 0.30 0.80 C 30 0.80 0.60 1.00 0.90 0.50 0.80
;
run;
proc sgplot data=forest_data;
scatter x=XValue y=a1 / yerrorlower=lowa1 yerrorupper=uppera1;
scatter x=XValue y=a2 / yerrorlower=lowa2 yerrorupper=uppera2;
yaxis label="Odds Ratio" ;
run;
... View more
Every SAS Viya platform deployment includes the SAS Workload Orchestrator, a powerful tool for managing SAS programming runtime workloads. But every organization is different, and you can tailor it to your needs with a suite of deployment customizations. In this article, we’ll walk through each customization option, exploring not just the “how,” but also the “why”.
... View more
Take the stage at SAS Innovate 2026! We're looking for outcome-driven, demo-ready presentations that spark curiosity and deliver impact. Share your proposal by November 7.